manirpg Posted June 7, 2010 Share Posted June 7, 2010 Dear friends, I need a lisp for change the insertion point of block.help me. in my dwg having many blocks, but some of the blocks insertion point not specified correctly (on the object or near the object).if i select one of these block, insertion point not vissible (node). so i want to change insertion point easily by two steps. select block and specify insertion point. without makes any changes in oriantation of block used in the whole dwg. Thanks in advance.:) Regards Mani Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 7, 2010 Share Posted June 7, 2010 You could change the block insertion point for every block in the drawing by changing the block definition. Look into the 'Origin' property, or DXF group 10 of the block definition. Quote Link to comment Share on other sites More sharing options...
CADmium Posted June 7, 2010 Share Posted June 7, 2010 Try www dot d -tools.eu Tool 48 ?! Quote Link to comment Share on other sites More sharing options...
manirpg Posted June 9, 2010 Author Share Posted June 9, 2010 Dear Lee , Sorry ,I can’t understand ur reply. I need to update in my existing drawing, so how can help the block definition window? In my drawing had a blocks. I am using this macro, this is working but each execution i am giving block name twise, so i want to avoid block name input? help me. I attached 2 examples....... (without changing block orientation changed the insertion point) help me anybody macro: ^C^C-ren;b;\name;^C-insert;name;0,0;1;;0;^Cz;o;l;;_explode;L;^C^Cm;p;;\ ^C^C-block;name1;@;p;;-insert;name1;@;1;;0; -block;name;y;0,0;l;;^Cssx;;b;name;;^Cxplode;p;;g;e;^Cz;p;^C-ren;b;name1;\ ^C-pu;b;name;n;^C Thanks Regards mani Quote Link to comment Share on other sites More sharing options...
VVA Posted June 9, 2010 Share Posted June 9, 2010 1. Try _bedit _bsave and _bclose command 2. Look into the 'Origin' property Found here (defun selobj () (if (not (vl-catch-all-error-p (vl-catch-all-apply '(lambda () (vla-getEntity util 'obj nil "Select Block: ")))));not obj (progn (alert "Nothibg Selected. Try Again!") (selobj))) (if (/= (vla-get-ObjectName obj) "AcDbBlockReference") (alert "This Is Not A Block! Try Again!") obj) );selobj ; (defun C:ChInsPt ( / adoc util bks bk prp) (setq adoc (vla-get-ActiveDocument (vlax-get-acad-object))) (mapcar '(lambda (x y) (set x (vlax-get-property adoc y))) '(util bks) '("Utility" "Blocks")) (vla-endundomark adoc) (vla-startundomark adoc) (vla-highlight (selobj) t) (setq prp (mapcar '(lambda (x) (vlax-get-property obj x)) '(InsertionPoint XScaleFactor YScaleFactor Rotation)) ip1 (vla-getPoint util nil "Select New Insertion Point") rv (mapcar '(lambda (y) (apply y (mapcar '(lambda (x) (vlax-safearray->list (vlax-variant-value x))) (list (car prp) ip1)))) '(distance angle)) bk (vla-item bks (vla-get-name obj)));setq (vla-put-origin bk (vlax-3d-point (polar (vlax-get bk 'Origin) (* (cadr rv) (/ (nth 1 prp) (nth 2 prp))) (- (car rv) (last prp))))) (vla-update obj) (vla-regen adoc acAllViewports) (vla-endundomark adoc) );end Quote Link to comment Share on other sites More sharing options...
manirpg Posted June 9, 2010 Author Share Posted June 9, 2010 Dear VVA, Thanks for reply but its not given proper output.but block objects location changed after execution. see the attachment. Thanks Regards mani Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 9, 2010 Share Posted June 9, 2010 (edited) This seemed interesting so I thought I'd take a stab at it Code does the same thing as that which VVA posted, but uses a different method Edited July 31, 2010 by Lee Mac Quote Link to comment Share on other sites More sharing options...
manirpg Posted June 10, 2010 Author Share Posted June 10, 2010 Dear Lee, Your code also working same like code posted by VVA. Both of giving same output. otherwise i need a lisp for giving output block name which block i am selected, some one help me................ Thanks to all Regards mani Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 10, 2010 Share Posted June 10, 2010 Updated my code to account for blocks with OCS different to WCS. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 10, 2010 Share Posted June 10, 2010 See here Mani Quote Link to comment Share on other sites More sharing options...
manirpg Posted June 11, 2010 Author Share Posted June 11, 2010 Hi, Mr.LEE still the result coming not proper. my requirement is After changed the insertion point,blocks position should not change. pls see my images....... also my macro. If any one want to check my macro here the procedure. 1.select the block 2.click macro button 3.block name input(which one selected) 4.click new insertion point 5.block name input(which one selected),same as step 3 input now u get the result........... Thanks lee I am awaiting....... Regards mani:) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 11, 2010 Share Posted June 11, 2010 See the link I posted Quote Link to comment Share on other sites More sharing options...
manirpg Posted June 11, 2010 Author Share Posted June 11, 2010 Hi Lee, Thank you very much........................ Now its working fine............ Also thanks to link...........(i think i got one more good forum) Thanks for both Regards Mani:D:D:D Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 11, 2010 Share Posted June 11, 2010 You're welcome Mani Quote Link to comment Share on other sites More sharing options...
jcap91163 Posted July 31, 2010 Share Posted July 31, 2010 the CBI routine is great, many thanks for your work Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted July 31, 2010 Share Posted July 31, 2010 the CBI routine is great, many thanks for your work Hi JCap, I'm glad you like it - I have removed the old code from my earlier post, see the link I posted for the latest code. Quote Link to comment Share on other sites More sharing options...
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.