pmxcad Posted July 31, 2011 Share Posted July 31, 2011 Hello, Question: I`ve about 25 drawings in witch have to update a block. That block has a new attribute. Normaly i have to open the drawing, insert the the modified block, run battman and hit the sync button. Is there a lisp for this to do it in one time for all selected drawings? Like selecting the drawings, select the block file, and after that run battman, sync. and so update al the selected drawings. Thanks Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 31, 2011 Share Posted July 31, 2011 Try this buddy . (defun c:Test (/ ss) ;; Tharwat 31. 07. 2011 (if (setq ss (ssget "_x" '((0 . "INSERT") (66 . 1)))) (command "_.attsync" "_select" ss "" "_Yes") ) (princ) ) Tharwat Quote Link to comment Share on other sites More sharing options...
pmxcad Posted July 31, 2011 Author Share Posted July 31, 2011 Try this buddy . (defun c:Test (/ ss) ;; Tharwat 31. 07. 2011 (if (setq ss (ssget "_x" '((0 . "INSERT") (66 . 1)))) (command "_.attsync" "_select" ss "" "_Yes") ) (princ) ) Tharwat OK Tarwat................... How does it work? I want to select multiple drawings and a choose a external block file with that new attribute and applay battman/sync to al selected drawings. Tanks Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 31, 2011 Share Posted July 31, 2011 Copy codes to your command line and type test to update all att blocks in the current drawing , but it does not work for selected drawings (because that is a very big routine and out of my capabilities) So some better than nothing . BTW it is Tharwat not Tarwat . Enjoy it . Quote Link to comment Share on other sites More sharing options...
pmxcad Posted July 31, 2011 Author Share Posted July 31, 2011 Sorry Tharwat, Is it possible to convert this lisp to script (scr)? I got Autcad electrical and i can run a project wide script. I can run the script for al the drawings in a project.So it would be very nice if it is possible to convert the lisp to a script. Thanks............ Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 31, 2011 Share Posted July 31, 2011 No worries Buddy . It's been for a long time now that I have not used scripts but I think the following one is correct and please try it and tell me back . Codes must be as they are in three lines . attsync select (setq ss (ssget "_x" '((0 . "INSERT") (66 . 1)))) Quote Link to comment Share on other sites More sharing options...
irneb Posted August 1, 2011 Share Posted August 1, 2011 Actually if you know the block's name you don't even need the lisp ... just run it directly in a SCR file through ScriptPro / AutoScript / EZScript / Lee's ScriptWriter / BatchLisp / etc. Your script would be something like this: AttSync Name MyBlockName QSAVE What I'd really like though is to have BAttMan/AttSync only work on selected blocks ... note what they do when the block is mirrored! Quote Link to comment Share on other sites More sharing options...
pmxcad Posted August 1, 2011 Author Share Posted August 1, 2011 You don`t have that problem with dynamic blocks............ pmxcad Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 1, 2011 Share Posted August 1, 2011 You don`t have that problem with dynamic blocks............ pmxcad Is this the result of your trying the codes ? Quote Link to comment Share on other sites More sharing options...
pmxcad Posted August 1, 2011 Author Share Posted August 1, 2011 Yep............top...super. Thanks 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.