How to set the "Border Offset Factor" value in Autocad using Autocad commands or Autocad Object Model?

edushka228
Enthusiast
Enthusiast

How to set the "Border Offset Factor" value in Autocad using Autocad commands or Autocad Object Model?

edushka228
Enthusiast
Enthusiast

The task is to set the "Border offset factor" value for the active document in Autocad using Autocad commands or Autocad Object Model

0 Likes
Reply
1,325 Views
19 Replies
Replies (19)

imadHabash
Mentor
Mentor

Hi,

The background in Mtexts or Multileaders with Mtext the Border Offset factor is equal to 1.5 by default. 

  • You can select all of your Mtexts then press Ctrl+1 .. from Properties Palette  select Background mask set the Border Offset factor and the color as needed.
  • OR you can edit your registry file ( regedit.exe ) from your Windows OS . But you have to be careful when you do this to avoid any harm to your program.

Imad Habash

EESignature

0 Likes

edushka228
Enthusiast
Enthusiast

i need to change the default value using Autocad commands. Is there a command that allows me to do this? If not, how exactly to edit the registry?

0 Likes

imadHabash
Mentor
Mentor

You cannot change it from AutoCAD commands!! 

>> how exactly to edit the registry?
Open the Windows Run dialog box by pressing the Windows + R keys .

Imad Habash

EESignature

0 Likes

edushka228
Enthusiast
Enthusiast

I know how to open the registry. I don't understand how to find what I need in the registry.

0 Likes

pendean
Community Legend
Community Legend

edushka228
Enthusiast
Enthusiast

edushka228_0-1712721905971.png

There is no TextMask_BackgroundScale parameter in the registry, but there are these ones. Which of them should be changed? I need to enter the value 1.1, instead of 1.5, which is set by default

0 Likes

TomBeauford
Collaborator
Collaborator
I've looked be never found that windows registry key so let us know if you found it.
Many of them aren't saved or aren't saved where you'd expect.
I use Layer States extensively that only include layers they're designed to modify so to prevent the rest of the layers from being turned off I added this to my acaddoc.lsp to prevent it as the value isn't saved.

(vl-registry-write (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Profiles\\" (getvar "cprofile") "\\Dialogs\\AcLayerApps:LayerStatesManager") "LayerNotFound" "0")
; Layer States Manager - Do not turn off layers not found in layer state

You're probably better off with one of those lisp routines, both of them work great!
64bit AutoCAD Map & Civil 3D 2023
Architecture Engineering & Construction Collection
2023
Windows 10 Dell i7-12850HX 2.1 Ghz 12GB NVIDIA RTX A3000 12GB Graphics Adapter
0 Likes

edushka228
Enthusiast
Enthusiast

I used the BGTOOGLE lisp you posted. It does not change the border offset factor.

0 Likes

cadffm
Consultant
Consultant

@edushka228  schrieb:

There is no TextMask_BackgroundScale parameter in the registry, but there are these ones. Which of them should be changed? I need to enter the value 1.1, instead of 1.5, which is set by default


If there isn't, it wasn't used before (or you are at the wrong registry path),

HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\Rnn.n\ACAD-nnnn:nnn\MTEXT\

 
 

 

 

Sebastian

0 Likes

edushka228
Enthusiast
Enthusiast

edushka228_0-1712740874228.png

 

0 Likes

cadffm
Consultant
Consultant

This is how it looks after install and you never used MTextbackground (in your CIVIL3D 2024).

 

Did you used MText-background in your Civil3D 2024?

If so, you have a problem: It looks like you (the program) don't have write access to this part of the registry

and that means - you have a lot trouble (not just the Mtext border scale).

 

Please test this:

Restart Civil3D 2024, create a MText and set background with a border scale of 3

Check the registry keys again, press [F5] for refresh regedit.

Still AutoStack the only item in this path?

 

 

Sebastian

0 Likes

edushka228
Enthusiast
Enthusiast

I don't have civil 3d, I work in autocad...

0 Likes

cadffm
Consultant
Consultant

But your screenshot showing a path for AutoCAD Civil3D 2024, not for AutoCAD 2024.

(so, Civil3D IS OR WAS installed on this PC)

This is AutoCAD 2024:

HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R24.3\ACAD-7101:4nn

 

 

 

Sebastian

0 Likes

cadffm
Consultant
Consultant

What's up?

 

If you don't have this folder:  C:\Program Files\Autodesk\AutoCAD 2021\C3D\   , you don't need to try this:

[Win]+[R]

open: "C:\Program Files\Autodesk\AutoCAD 2024\acad.exe" /ld "C:\Program Files\Autodesk\AutoCAD 2024\AecBase.dbx"  /product "C3D" /language "en-US"

[OK]

 

..to run Civil3D2024

 

Do you have this folder?

HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R24.3\ACAD-7101:......................

 

 

 
 

 

 

Sebastian

0 Likes

wispoxy
Advisor
Advisor

The answer is you cannot, it's not an option, it's hard coded with no public varible.

0 Likes

wispoxy
Advisor
Advisor
It doesn't even work using the Action Macro Recorder.
0 Likes

pendean
Community Legend
Community Legend
0 Likes

TomBeauford
Collaborator
Collaborator

BGtoggle toggles the background On/Off of selected TEXT & MTEXT and sets 'Border Offset Factor' to 1.15, the background color to drawing background color and trims excess width.

Latest version attached.

 

You can set the 'Border Offset Factor' in the MTEXT dialog box or in the Properties Palette.

64bit AutoCAD Map & Civil 3D 2023
Architecture Engineering & Construction Collection
2023
Windows 10 Dell i7-12850HX 2.1 Ghz 12GB NVIDIA RTX A3000 12GB Graphics Adapter
0 Likes

pendean
Community Legend
Community Legend

@edushka228 wrote:

There is no TextMask_BackgroundScale parameter in the registry, but there are these ones. Which of them should be changed? I need to enter the value 1.1, instead of 1.5, which is set by default


pendean_0-1712761919428.png

 

0 Likes