Visual LISP, AutoLISP and General Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Quick block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I have migrated o a new office and I am looking for a Lisp routine that used to make Blocks in-place instantly. he name of the block doesn't matter, but it can't be an anonymous block (I already have that routine!)
Does anyone have this lisp routine they could share? Basically, you run the Lisp command, select whatever you want and it instantly transforms your selection into a randomly named block. I think I got this routine off of a Hot Tip Harry website a LONG time ago.
HELP!
Solved! Go to Solution.
Re: Quick block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Things like this .... ?
(defun c:Test (/ selectionset insertionpoint number Blockname)
;;; Tharwat 11. May. 2012 ;;
(if (and (setq selectionset (ssget "_:L"))
(setq insertionpoint (getpoint "\n Specify insertion point :"))
)
(progn
(setq number 1
Blockname (strcat "MyBlock" (itoa number))
)
(while (tblsearch "BLOCK" Blockname)
(setq Blockname
(strcat "MyBlock" (itoa (setq number (1+ number))))
)
)
(command "_.-Block" Blockname insertionpoint selectionset ""
)
)
(princ)
)
(princ)
)
Re: Quick block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Almost! I ran this lisp and it deletes the original content, but I just want to convert a selection to a named block, in place, without having to reinsert it.
THANK YOU FOR YOUR HELP!
Re: Quick block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
With the adds of command call insert , we will re-insert the same block name in its chosen insertion point . ![]()
Try and tell me back ..
(defun c:Test (/ selectionset insertionpoint number Blockname)
;;; Tharwat 11. May. 2012 ;;
(if (and (setq selectionset (ssget "_:L"))
(setq insertionpoint (getpoint "\n Specify insertion point :"))
)
(progn
(setq number 1
Blockname (strcat "MyBlock" (itoa number))
)
(while (tblsearch "BLOCK" Blockname)
(setq Blockname
(strcat "MyBlock" (itoa (setq number (1+ number))))
)
)
(command "_.-Block" Blockname insertionpoint selectionset "")
(command "_.-insert" Blockname insertionpoint "" "" "")
)
(princ)
)
(princ)
)
Re: Quick block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Perfect!!! Way to go!
Re: Quick block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
ericwhitmore wrote:.... Basically, you run the Lisp command, select whatever you want and it instantly transforms your selection into a randomly named block. I think I got this routine off of a Hot Tip Harry website a LONG time ago.
....
This is from Hot Tip Harry's website [Cadalyst] -- might it be the one? It doesn't name it randomly, though. And I didn't download it and try it. But it came up when I searched for "quick block":
http://cadtips.cadalyst.com/standard-blocks/quick-
Re: Quick block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
ericwhitmore wrote:Perfect!!! Way to go!
Enjoy it . ![]()
Tharwat
Re: Quick block
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thanks, this really helps!
