Author Topic: Background grid with LISP  (Read 994 times)

0 Members and 1 Guest are viewing this topic.

keithsCADservices

  • Newt
  • Posts: 45
Background grid with LISP
« 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.

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: Background grid with LISP
« Reply #1 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.
A man who never made a mistake never made anything

keithsCADservices

  • Newt
  • Posts: 45
Re: Background grid with LISP
« Reply #2 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 :-( .

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: Background grid with LISP
« Reply #3 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.
A man who never made a mistake never made anything

keithsCADservices

  • Newt
  • Posts: 45
Re: Background grid with LISP
« Reply #4 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.


BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: Background grid with LISP
« Reply #5 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.
A man who never made a mistake never made anything

keithsCADservices

  • Newt
  • Posts: 45
Re: Background grid with LISP
« Reply #6 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.

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: Background grid with LISP
« Reply #7 on: May 11, 2023, 08:56:51 PM »
Lee-mac.com has a work out color numbers has various output functions.
A man who never made a mistake never made anything

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Background grid with LISP
« Reply #8 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 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"))))