Guest Brian_MMC Posted March 18, 2010 Share Posted March 18, 2010 I have a hand full of different blocks that I need to show up at the justification point on some selected text. Is it possible to have the block automatically be placed to an item like this? I think anything would be better than adding them one by one around the drawing. Currently I’m using quick select to pick out the needed text and moving them 1000’ to the right filling in the blocks and moving everything back. Thank you for your ideas in advance. Brian, Quote Link to comment Share on other sites More sharing options...
lpseifert Posted March 18, 2010 Share Posted March 18, 2010 You could try this... not extensively tested and kinda bucolic (defun c:test (/ str bn ss idx tobj) (vl-load-com) (setq str (getstring T "\nEnter text: ") bn (getstring T "\nEnter Block name: ") ss (ssget "X" '((0 . "*TEXT"))) idx 0 ) (if (not (tblsearch "BLOCK" bn)) (princ (strcat "\nBlock " bn " doesn't exist in the drawing")) (progn (repeat (sslength ss) (setq tobj (vlax-ename->vla-object (ssname ss idx))) (if (= (strcase (vlax-get-property tobj 'Textstring)) (strcase str)) (vl-cmdf "insert" bn (vlax-get tobj 'InsertionPoint) "" "" "") ) (setq idx (1+ idx)) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Ryder76 Posted March 18, 2010 Share Posted March 18, 2010 ... not extensively tested and kinda buccolic buccolic... Quote Link to comment Share on other sites More sharing options...
Guest Brian_MMC Posted March 19, 2010 Share Posted March 19, 2010 Thanks i will give it a try. 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.