Jump to content

Copy layout/ bordering issue


Charpzy

Recommended Posts

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:
image.png.9c2a1a3d01fd0f749d7ee107c29a0839.png

 

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:
image.png.174d17aa324c15e658e3cddf6da1dce1.png

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")

Link to comment
Share on other sites

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:
image.png.9c2a1a3d01fd0f749d7ee107c29a0839.png

 

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:
image.png.174d17aa324c15e658e3cddf6da1dce1.png

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.

 

 

 

Link to comment
Share on other sites

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.

image.png.8eb4528f658d561885b80ad5b7d8d763.pngimage.png.da7b6c74d5c8abd4fba8229b7db78570.png

Has advantage of angle also.

 

layout1.png.74494f6fad3fb6057d1290aeb15d2dbb.png

Edited by BIGAL
  • Like 1
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 :beer: as payment.

Link to comment
Share on other sites

 

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
image.png.9b919f41ecbf8ee698ea5b9933f88cc5.png

 

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...