Restoring System Variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Full disclosure I am a complete novice with writing LISP and I have probably made this harder than it needs to be. I have a simple routine that changes the layer, inserts a block and rotates it. What I want to do is store the ANGBASE before insertion and change it when I insert the block and then reset the ANGBASE to the original value at the end. For the life of me I cant get it to work as it doesnt reset the stored ANGBASE.
Any help would be greatly appreciated, here is what I have:
(defun c:iblock ()
(setq Old_ANGBASE (getvar "ANGBASE"))
(setvar "ANGBASE" 0)
(command "layer" "s" "L_Block" "")
(command "insert" "B_Block" pause "" "")
(setq pt (cdr (assoc 10 (entget (entlast)))))
(command "rotate" "L" "" pt )
(setvar "ANGBASE" Old_ANGBASE)
(princ)
)