HELP:Advise on script to inser
I needed to insert a block into many drawings at the same location.After some study, I am able to run this script with scriptpro.
ATTREQ 1ATTDIA 0-INSERT"*d:\new block.dwg"2527.1006043527,827.369441206792310saveyBut the issue is i have 2 layout. The above script will only insert to the default layout only.
Can someone advise how insert in both layout?
Thanks Verysimple the ctab variable can be used to change layouts so in your script (Setvar "ctab" "layout 2") and add Mspace Z E just in case your inside a layout viewport other wise it will insert in the model. NOTE must use brackets this is a mini lisp command in a script .
Ok. I will give it a shot.
BTW, since you mention it is now a mini lisp command in a script, i can still run it with scriptpro?
Thanks You could use BIGAL's idea just adding the 2 lines to your script
CTABlayout 2
I honestly don't know if it will make a difference, being an LT user I don't know the effects of adding lisp code to scripts Try replacing your insert part of the script with this.
(foreach layout (layoutlist) (setvar "ctab" layout) (command "pspace") (command "-insert" "d:\new block.dwg" "2527.1006,827.3694" "1" "0")) Sorry it will not work with LT Steven is correct just do it as a command you can do on one line if you like
Ctab "layout 2" use " if you have spaces in layout name. BIGAL I don't think the OP has LT I just added the comment for any possible LT users who may look-in :>) Hi guys. Thanks for the input. I am using autocad full version.
I will try to study all inputs & see how to work it out.
Thanks Hi JamCAD.
I add in as suggested in 2 different ways and i got errors for both.
1st way script
ATTREQ 1ATTDIA 0-INSERT(foreach layout (layoutlist) (setvar "ctab" layout) (command "pspace") (command "-insert" "d:\new block.dwg" "2527.1006,827.3694" "1" "0"))10savey
1st way error
2nd way script
ATTREQ 1ATTDIA 0(foreach layout (layoutlist) (setvar "ctab" layout) (command "pspace") (command "-insert" "d:\new block.dwg" "2527.1006,827.3694" "1" "0"))10savey
2nd way error
What did I do wrong?
Got it working with this script.
ATTREQ 1ATTDIA 0ctabA2-INSERT"*d:\new block.dwg"2527.1006043527,827.369441206792310ctabA3-INSERT"*d:\new block.dwg"2527.1006043527,827.369441206792310savey
Thanks guys
页:
[1]
2