TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: keithsCADservices on May 07, 2023, 10:31:29 PM

Title: Background grid with LISP
Post by: keithsCADservices on May 07, 2023, 10:31:29 PM
I've found how to edit most settings, but not the background grid. Most searches lead me to table gridlines. Is it possible?

I'm trying to find a way around the lack of having profiles available in ACAD LT.
Title: Re: Background grid with LISP
Post by: BIGAL on May 08, 2023, 03:36:54 AM
Explain more if you want like road profiles then LT will not help. yeah LT 2024 has lisp but I would go Bricscad and Civil Site Design you will get so much more out of it.
Title: Re: Background grid with LISP
Post by: keithsCADservices on May 08, 2023, 10:52:01 PM
BIGAL: I think you replied to the wrong topic.

I have tried BricsCAD however. And quite extensively. It didn't work that well for me unfortunately. Hence why I pay for AutoCAD every year :-( .
Title: Re: Background grid with LISP
Post by: BIGAL on May 09, 2023, 01:19:18 AM
Think I understand now your talking about Options, Profiles, save/load as ARG file etc. the /P switch in the start up.

If correct there may be a way around the problem.
Title: Re: Background grid with LISP
Post by: keithsCADservices on May 09, 2023, 09:07:49 AM
The default grid color with a black background looks pretty okay. But when I switch to a white/off-white background, it looks not great. Some workflow(s) having me switching from one to another.

I realize that I can't access several other settings as well. And only a few things are accessible (crosshair color, etc...) so it might be a lost cause.

As of now I'm pondering two separate installs.

Title: Re: Background grid with LISP
Post by: BIGAL on May 09, 2023, 07:45:18 PM
Buried away in the registry is stuff like set this color, the problem is finding the value to change and even if you do the value, its often like 172356.

I have changed values and yes worked but you have to be super careful playing with the registry. Plain LT does not support the lisp (setenv which will reset registry.
Title: Re: Background grid with LISP
Post by: keithsCADservices on May 09, 2023, 11:58:58 PM
Thanks BIGAL! "setenv" is the key to winning on this.

The good thing is that I can simply grab the numbers once I set my grid(s) the the desired numbers. This should also prevent damaging the registry? There will be no options for example, for a user to pick their own colors.

I did see someone post a way to convert colors from RGB to these numbers. I'll post that if I come across it. I won't need it though.

This is how I'll get my colors:

Command: (getenv "2D Model grid major lines color")
"6901577"
Command: (getenv "2D Model grid minor lines color")
"4732722"

Setenv will also help me access a few of the other settings I need.

This link demonstrates setenv in a similar way to what I'll be using it for:

https://forums.autodesk.com/t5/autocad-for-mac-forum/how-to-change-grid-line-colour/td-p/9496642

Thanks so much BIGAL.
Title: Re: Background grid with LISP
Post by: BIGAL on May 11, 2023, 08:56:51 PM
Lee-mac.com has a work out color numbers has various output functions.
Title: Re: Background grid with LISP
Post by: Lee Mac on May 12, 2023, 06:47:14 AM
Command: (getenv "2D Model grid major lines color")
"6901577"
Command: (getenv "2D Model grid minor lines color")
"4732722"

They look to be OLE colours - you can test this using my OLE->True (http://lee-mac.com/colourconversion.html#oletru) conversion function and the following code:
Code - Auto/Visual Lisp: [Select]
  1. ((lambda ( c ) (entmake (list '(0 . "LINE") '(10 0 0 0) '(11 10 0 0) (cons 420 c)))) (LM:ole->true (atoi (getenv "2D Model grid minor lines color"))))