Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Block Insertion snap problem

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
BudMcGregor
1142 Views, 6 Replies

Block Insertion snap problem

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.Example.jpg


My question is: What am I doing wrong?  Until AutoCAD 2013 this script worked.

6 REPLIES 6
Message 2 of 7
pendean
in reply to: BudMcGregor

Looking at your insertion points, 6.5,18.25 is repeated except for one instance where it jumps to 6.5,20.
Is that where you think "snap" kicked in? Otherwise you seem to be inserting everything else right on top of each other.
Message 3 of 7
Kent1Cooper
in reply to: BudMcGregor


@BudMcGregor 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.
Kent Cooper, AIA
Message 4 of 7
pendean
in reply to: Kent1Cooper

If it is OSNAP, simply add this to the top of your script:

OSMODE
0 <<<< that's a zero
Message 5 of 7
BudMcGregor
in reply to: BudMcGregor

Thanks for your input.
The duplicated Y-axis numbers (18.25) are intended to position the block (ldiline) containing lines and the block (ldiLDI) containing text and attributes in the same vertical location. The blocks are inserted in pairs with an insertion of the line block and an insertion of a specific text block.

William McGregor
Controls Drafter

FS-Elliott Co., LLC
Tel: +1 724-387-3247
Fax: +1 724-387-4921
Email: wmcgrego@fs-elliott.com
Web: www.fs-elliott.com

[FS-Elliott Logo]

THIS E-MAIL MESSAGE AND ANY ATTACHMENTS ARE INTENDED FOR THE USE OF THE INDIVIDUAL OR ENTITY TO WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to this message and destroy all copies of this message and any attachments. Thank you.
Message 6 of 7
Kent1Cooper
in reply to: pendean


@pendean wrote:
If it is OSNAP, simply add this to the top of your script:

OSMODE
0 <<<< that's a zero

[I don't think there's any if about it....]  Another way to do the same thing:
 

-osnap

off

Kent Cooper, AIA
Message 7 of 7
BudMcGregor
in reply to: pendean

Thanks.
Both solutions work.

I appreciate the help.

William McGregor
Controls Drafter

FS-Elliott Co., LLC
Tel: +1 724-387-3247
Fax: +1 724-387-4921
Email: wmcgrego@fs-elliott.com
Web: www.fs-elliott.com

[FS-Elliott Logo]

THIS E-MAIL MESSAGE AND ANY ATTACHMENTS ARE INTENDED FOR THE USE OF THE INDIVIDUAL OR ENTITY TO WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to this message and destroy all copies of this message and any attachments. Thank you.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost