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.


Registered forum members do not see this ad.
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
Code:_-insert D:\Personal\CAD\Research\titleblocktext_att.dwg _yes 0,0 _erase _L attsync n plankopf_att_neu _qsave
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.
http://cadtempo.blogspot.com Visit my Blog!

How about, renaming the existing block before inserting the new block?
...
peace out
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.
"That's it. It's one thing for a ghost to terrorize my children, but quite another for him to play my Theremin." Homer Simpson
Dave
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:
Code:(if (tblsearch "block" "titleblocktext_att") ;**insert your code here )


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
Thanks again for taking interest in this one. Always appreciated.Code: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
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.
"That's it. It's one thing for a ghost to terrorize my children, but quite another for him to play my Theremin." Homer Simpson
Dave


Just wanted to be on the safe side
Bookmarks