blueshake Posted October 5, 2010 Posted October 5, 2010 hi,all I noticed that when I click the "block" command from the toolbar icon.then cad jump out a dialogue. from the dialogue ,there is one option for block store. it provide three choice. 1.reserve 2. change it into block 3 delete.when I choose objects and choose 2 .the drawing still stay in cad and become a block. but when I do the "-block" from command line.the objects are deleted . so how do I do to make cad play the trick of toolbar from command line. or lisp routine. thanks. (command "_.-block" pause) Quote
blueshake Posted October 5, 2010 Author Posted October 5, 2010 the following codes can do the same as toolbar. (initdia) (command "_.block" pause) but I want to do the thing in lisp including choose the option "change it into block". Quote
blueshake Posted October 5, 2010 Author Posted October 5, 2010 @David thank you for your reply, (command "_.block" pause) (command "_.oops) I knew this can revert the objects "block" command deleted.but the things reverted are still not block,they are what they were. the option "change it into block "can make objects become a block. Quote
David Bethel Posted October 5, 2010 Posted October 5, 2010 The only way is to INSERT the BLOCK after it is made. -David Quote
blueshake Posted October 5, 2010 Author Posted October 5, 2010 @David according to your advice. I code these snippet ,but it fail any comment on this ?thanks. (defun c:merge_block(/) (setvar "LUNITS" 2) (setq blockNmae (rtos (getvar "cdate") 2 6)) (setq basePoint (getpoint "choose base point:")) (setq selEnt (entget "select objects:")) (command "_.-block" blockNmae basePoint selEnt "") (command "_.-insert" blockNmae 1 basePoint) ) Quote
David Bethel Posted October 5, 2010 Posted October 5, 2010 [b][color=BLACK]([/color][/b]defun c:mblk [b][color=FUCHSIA]([/color][/b]/ bn bp ss[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq bn [b][color=NAVY]([/color][/b]rtos [b][color=MAROON]([/color][/b]fix [b][color=GREEN]([/color][/b]* [b][color=BLUE]([/color][/b]getvar [color=#2f4f4f]"CDATE"[/color][b][color=BLUE])[/color][/b] 100000[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] 2 0[b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq bp [b][color=NAVY]([/color][/b]getpoint [color=#2f4f4f]"\nBase Point <0,0,0>: "[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]or bp [b][color=NAVY]([/color][/b]setq bp '[b][color=MAROON]([/color][/b]0 0 0[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]while [b][color=NAVY]([/color][/b]not ss[b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]command [color=#2f4f4f]"_.BLOCK"[/color] bn bp ss [color=#2f4f4f]""[/color] [color=#2f4f4f]"_.INSERT"[/color] bn bp 1 1 0[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]prin1[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] Some of your problems CDATE contains a decimal point and is not a valid name (entget) doesn't create a PICKSET -David Quote
blueshake Posted October 5, 2010 Author Posted October 5, 2010 passed the cad,thank you very much Quote
David Bethel Posted October 6, 2010 Posted October 6, 2010 passed the cad,thank you very much Kind of a different way to put it You're welcome. -David Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.