TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: jlogan02 on November 15, 2019, 03:53:30 PM

Title: set dimscale according to border size
Post by: jlogan02 on November 15, 2019, 03:53:30 PM
We don't use paperspace, so we have 4 borders of varying sizes to accommodate scaled drawings.
I have a routine that currently checks the dimscale and inserts a new attributed title block and border to replace the existing one. This all works great provided the dimscale is correct. If it's not things don't go as planned.

Seems to me I need to...
Check the current dimstyle
If it is annotative, make it X dimstyle. ;;easy enough

Find the length of the bottom segment of the polyline border. ;;I've found examples, seems doable.

If dimscale isn't equal to the segment length, make it so. Now...it's not really equal but you get the point. The line would be X long with Y dimscale and Z long with AA dimscale ;;not a clue on how to accomplish this.

Maybe make a list of the standard dimscales and a list of lengths for the bottom segment line to check against. I don't know...I feel like I'm guessing.
Title: Re: set dimscale according to border size
Post by: tombu on November 15, 2019, 04:12:29 PM
Not that plotting from Model Space makes any sense to me, but if I was to attempt it I'd set MSLTSCALE to the scale needed for plotting first since an annotative scale would work for all your plot sizes. Then inserts a new attributed title block to match the MSLTSCALE value.
Title: Re: set dimscale according to border size
Post by: jlogan02 on November 18, 2019, 11:00:20 AM
You're going to have to explain this more because I don't see how addressing plotting helps my situation at all. My problem is inserting a new title block at scale in drawings that are NOT supposed to have Annotative anything.

Don't get me wrong, I agree that paperspace is the better method for plotting. I've been trying to get that changed for 20 years. 20 years!!!! It ain't going to change. Even if it did change it still wouldn't address the issue of having some existing annotative drawings and some non-annotative while trying to insert an updated title block in drawings currently using scaled title blocks in modelspace.
Title: Re: set dimscale according to border size
Post by: tombu on November 18, 2019, 11:36:02 AM
Sorry, MSLTSCALE wouldn't help you at all. Maybe if the Annotation Scale was set first you could use one border inserted at a scale of 1/ CANNOSCALEVALUE for whatever scale you're using.

Maybe use EXTMIN & EXTMAX to calculate how big a border you will need.

I should have skipped this one, not an area I'm that familiar with.
Title: Re: set dimscale according to border size
Post by: jlogan02 on November 18, 2019, 12:10:37 PM
Not a problem. You had me thinking I was missing something there for a second.
Title: Re: set dimscale according to border size
Post by: jlogan02 on November 18, 2019, 12:12:06 PM
The extmin, extmax idea might be something to look at though. Thanks.
Title: Re: set dimscale according to border size
Post by: ronjonp on November 18, 2019, 12:40:50 PM
You're going to have to explain this more because I don't see how addressing plotting helps my situation at all. My problem is inserting a new title block at scale in drawings that are NOT supposed to have Annotative anything.

Don't get me wrong, I agree that paperspace is the better method for plotting. I've been trying to get that changed for 20 years. 20 years!!!! It ain't going to change. Even if it did change it still wouldn't address the issue of having some existing annotative drawings and some non-annotative while trying to insert an updated title block in drawings currently using scaled title blocks in modelspace.
20 years of plotting out of modelspace! You're a very patient person.  :lol:
Title: Re: set dimscale according to border size
Post by: DeeGeeCees_V.2.0 on November 19, 2019, 02:35:37 PM
I worked for a few places that had legacy CAD files like that and wouldn't change. Turrible places. lol

I'd go with grabbing the scale factor of the title block and then set the dimscale accordingly.

Titleblock scale = 1
Dimscale = 1

...or something similar.
Title: Re: set dimscale according to border size
Post by: PKENEWELL on November 19, 2019, 06:23:59 PM
I worked for a few places that had legacy CAD files like that and wouldn't change. Turrible places. lol

I'd go with grabbing the scale factor of the title block and then set the dimscale accordingly.

Titleblock scale = 1
Dimscale = 1

...or something similar.

Agreed. I also had to work at shops that refused to use anything but Model space. However if your title blocks are not BLOCKs but only text and lines, that's not going to work. I would hope that's not the case. You could also use the scale factor of the Border BLOCK if you can't use the title block.
EDIT - I see in the OP that the title blocks ARE actually attributed blocks.

The only other option would be to hard code the 1:1 scale of the border into the Lisp (or into the registry or a file that you can retrieve), do a bounding box on the border lines, then compare the X distance of the actual Border with the 1:1 size. I had a program to insert borders and title blocks years ago, but it would set the Dimscale at the same time the scale was prompted for the Border insert.