layfrz BLOCK & ENTITY

layfrz BLOCK & ENTITY

SAFizzy
Advocate Advocate
1,239 Views
7 Replies
Message 1 of 8

layfrz BLOCK & ENTITY

SAFizzy
Advocate
Advocate

Hi,

can some one do a quick favor for me?

i am using layfrz command frequently but some time i need to frz full block/exref & some time only entity. but every time i have to change the setting for freezing entity and block. can some one make lisp with both options with 2 different commands.  like if i press 3, It frz entity and if i press 33, it frz block

 

Thanks

0 Likes
Accepted solutions (2)
1,240 Views
7 Replies
Replies (7)
Message 2 of 8

dbhunia
Advisor
Advisor
Accepted solution

Do you need this.......

 

(defun c:33 nil
  (command "_.LAYFRZ" "_S" "_B" "_B")
  (princ)
)

(defun c:3 nil
  (command "_.LAYFRZ" "_S" "_B" "_E")
  (princ)
)

Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 3 of 8

SAFizzy
Advocate
Advocate

thanks yes this is what i want.

can i merge some lisp together? as i can not load more lisp commands. or is there any way to increase the limit of lisp commands to be loaded at startup?

0 Likes
Message 4 of 8

dbhunia
Advisor
Advisor

one of the easiest way go through the "Startup Suite"........

 

where you can add multiple LISP, which you want to load with every drawings.......

 

Watch the video.......

 

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 5 of 8

SAFizzy
Advocate
Advocate

i already added in my startup suit and now its too many to load all. that's why i wanted to merge few of them, so i can get all custom commands. i don't want to load few and ignore others. 

0 Likes
Message 6 of 8

dbhunia
Advisor
Advisor
Accepted solution

Ok.......

 

Then Find acad<version>doc.lsp file in your system......... (like acad2019doc.lsp/acad2018doc.lsp/.........)

 

and put the 1 line (for each LISP) at the end......

(load "LISP File path")

Like.......

(load "C:\\Users\\............\\XXX\\3.lsp")
(load "C:\\Users\\............\\XXX\\33.lsp")

 

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 7 of 8

scot-65
Advisor
Advisor
Startup suite is a poor-man's way to load customization files.
Exporting the list to a newer version and total file count are 2 reasons.

Instead, create a "Master_Utility.lsp" file that has contents inside
as described inside message #6. In a nutshell, place the newly
created LSP file in a dedicated folder and add the corresponding
line inside the master utility file and you are good to go for the next
session. Portability is on your side using this method.

Use ACADDOC.lsp to load the master utility (not the file with the version number).

Place both the master utility and the ACADDOC file in a Support File Search Path.
A path in the trusted locations should also be checked.

Alternate is to declare lisp files inside the CUI.

There are additional hints and alternates if one uses the search feature
as this topic is one of the more frequently asked items on this board.

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

Message 8 of 8

pbelon
Explorer
Explorer

My option.

 

The values of the LAYFRZ commands are stored in the register. What I do is read the actual option, then change the value of the register to what i want. After that, I restore the value it had before.

The value are stored (autocad 2017) in  "HKEY_CURRENT_USER\\\Software\\Autodesk\\<CurProd>\\<CurVer>\\<CurVer>\\Profiles\\<user profile>\\Dialogs\\LayerTools". In this program I only use the "FRZ_BlockNesting" variable.

 

;; VARIABLES:
;; "FRZ_BlockNesting" = "0" [NONE]
;; "FRZ_BlockNesting" = "1" [BLOCK]
;; "FRZ_BlockNesting" = "2" [ENTITY]

;;; ***************************
;;; INUB - inutiliza por bloque-bloque (LAYFRZ option block-block)

(defun c:inub ( / key block_flag)
(setq key (read-reg))
(setq block_flag (vl-registry-read key "FRZ_BlockNesting"))
(vl-registry-write key "FRZ_BlockNesting" "1")
(WHILE (command "_.LAYFRZ"))
(vl-registry-write key "FRZ_BlockNesting" block_flag)
(princ)
)

;;; ***************************
;; INUE - inutiliza por bloque-entidad (LAYFRZ option block-entity)
(defun c:inue ( / key block_flag)
(setq key (read-reg))
(setq block_flag (vl-registry-read key "FRZ_BlockNesting"))
(vl-registry-write key "FRZ_BlockNesting" "2")
(WHILE (command "_.LAYFRZ" "\\"))
(vl-registry-write key "FRZ_BlockNesting" block_flag)
(princ)
)

;;; ***************************
; INUN - inutiliza bloque-ninguno (LAYFRZ option block-none)
(defun c:inun ( / key block_flag block_flagr)
(setq key (read-reg))
(setq block_flag (vl-registry-read key "FRZ_BlockNesting"))
(vl-registry-write key "FRZ_BlockNesting" "0")
(WHILE (command "_.LAYFRZ" "\\"))
(vl-registry-write key "FRZ_BlockNesting" block_flag)
(princ)
)

(defun read-reg ( / reg-dir key2 block_flag viewport_flag user_profile)
(setq reg-dir "HKEY_CURRENT_USER\\\Software\\Autodesk")
(setq reg-dir (strcat reg-dir "\\" (vl-registry-read reg-dir "CurProd")))
(setq reg-dir (strcat reg-dir "\\" (vl-registry-read reg-dir "CurVer")))
(setq reg-dir (strcat reg-dir "\\" (vl-registry-read reg-dir "CurVer")))


(setq user_profile (vl-registry-read (strcat reg-dir "\\Profiles")))
(setq key2 (strcat reg-dir "\\Profiles" "\\" user_profile))
(setq key2 (strcat key2 "\\Dialogs\\LayerTools"))
(setq viewport_flag (vl-registry-read key2 "FRZ_Vpfreeze"))
(setq block_flag (vl-registry-read key2 "FRZ_BlockNesting"))
(princ key2)
)

 

0 Likes