feargt Posted March 27, 2009 Share Posted March 27, 2009 Hi, I want to replace a block in a set of drawings with a script file. When I tried entering the commands on the command line with _insert autocad asked if i wanted to redefine the block. But when I use the script below to script is crashing because where Iam expecting the question whether I want to redefine the block autocad is actually looking for an insertion point. Is there something I am missing? Any ideas welcome. thanks _-insert D:\Personal\CAD\Research\titleblocktext_att.dwg _yes 0,0 _erase _L attsync n plankopf_att_neu _qsave Quote Link to comment Share on other sites More sharing options...
Patrick Hughes Posted March 27, 2009 Share Posted March 27, 2009 Look into including the "EXPERT" sysvar into your script before issue the command in question. Something like: expert 2 ... ... expert 0 You will also want to reset it afterwards. Quote Link to comment Share on other sites More sharing options...
kool130 Posted March 30, 2009 Share Posted March 30, 2009 How about, renaming the existing block before inserting the new block? ... peace out Quote Link to comment Share on other sites More sharing options...
dbroada Posted March 30, 2009 Share Posted March 30, 2009 that is certainly how I do it. Are you sure the "new" block resides in the drawing already? It sounds like its not there so doesn't need redefining. Quote Link to comment Share on other sites More sharing options...
alanjt Posted March 30, 2009 Share Posted March 30, 2009 Hi, I want to replace a block in a set of drawings with a script file. When I tried entering the commands on the command line with _insert autocad asked if i wanted to redefine the block. But when I use the script below to script is crashing because where Iam expecting the question whether I want to redefine the block autocad is actually looking for an insertion point. Is there something I am missing? Any ideas welcome. thanks _-insert D:\Personal\CAD\Research\titleblocktext_att.dwg _yes 0,0 _erase _L attsync n plankopf_att_neu _qsave when i type "insert" you will not get the same prompts as when you (command "insert"). the command way will prompt you for xyz coords, etc. you could just write it to only execute if it finds the block in your drawing: (if (tblsearch "block" "titleblocktext_att") ;**insert your code here ) Quote Link to comment Share on other sites More sharing options...
feargt Posted March 31, 2009 Author Share Posted March 31, 2009 So thank you for all the assistance. There was no one answer that did the trick. Was more of a combination of things. Below is the script that worked for me attdia 0 attreq 0 expert 2 _insert plankopf_att_neu=D:\Personal\CAD\Research\plankopf_att_neu.dwg 0,0 1 1 _erase _L attsync n plankopf_att_neu expert 0 _qsave Thanks again for taking interest in this one. Always appreciated. Quote Link to comment Share on other sites More sharing options...
dbroada Posted March 31, 2009 Share Posted March 31, 2009 I forgot about the = method. With that you are telling AutoCAD that the block must be redefined so I don't think you need to fiddle with the expert setting. Quote Link to comment Share on other sites More sharing options...
feargt Posted March 31, 2009 Author Share Posted March 31, 2009 Just wanted to be on the safe side Quote Link to comment Share on other sites More sharing options...
dbroada Posted March 31, 2009 Share Posted March 31, 2009 Just wanted to be on the safe side . 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.