I use a script to create an index of drawings in a set. Each line in the index is made of 2 blocks, first the lines of the chart and then an attributed text block. Both have the same origin point. My problem is that the blocks are being inserted as if the snap mode was on and the interval was too large causing tjhe lines to be inserted with every two lines of the index being placed on top of each other with a blank line in between. I have set the snap value in my template to be .01 and the snap value for each of the individual blocks to be .01 and, as an added measure, I turn off snap in my script before each insertion.
Here is the script for the header and the first line of the index:
;
filedia
0
cmddia
0
attdia
0
snap
off
new
Loop.DWT
regen
snap
off
-insert
indexhdr
6.5,20
1
1
0
snap
off
-insert
ldiline
6.5,18.25
1
1
0
snap
off
-insert
ldiLDI
6.5,18.25
1
1
0
XC-SP2596 ;This line is an attribute for a drawing number
0 ;As is this one for the revision level
snap
off
Attached is an image of the result.
My question is: What am I doing wrong? Until AutoCAD 2013 this script worked.
Solved! Go to Solution.
Solved by pendean. Go to Solution.
@Anonymous wrote:
.... My problem is that the blocks are being inserted as if the snap mode was on and the interval was too large causing tjhe lines to be inserted with every two lines of the index being placed on top of each other with a blank line in between. I have set the snap value in my template to be .01 and the snap value for each of the individual blocks to be .01 and, as an added measure, I turn off snap in my script before each insertion.
....
snap
off
-insert
....My question is: What am I doing wrong? Until AutoCAD 2013 this script worked.
It's not SNAP that you need to turn off, but OSNAP [Object Snap]. And you need to do it only once, provided you don't turn it on again in between. Alternatively, you could include a "none" entry just before all insertion points.