• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    AutoCAD 2010/2011/2012 DWG Format

    Reply
    Member
    Posts: 3
    Registered: ‎03-29-2012

    Inconsistent insertion of blocks

    131 Views, 5 Replies
    03-29-2012 08:02 AM

    I have several script commands that insert items such as title blocks (xrefs) and page boundaries (blocks). The base point and INSBASE for all files are set to 0,0,0. However the blocks will occassionally come in at different positions. In some cases I can repeat the command multiple times and each time the same block will inset at a different position in the same drawing even though the insert point is set to 0,0,0.

     

    This is a very annoying issue and seems unpredictable. I would appreciate any insight into what might be causing this.

     

    Autocad LT 2012

    Please use plain text.
    *Pro
    Posts: 1,738
    Registered: ‎12-08-2003

    Re: Inconsistent insertion of blocks

    03-29-2012 12:00 PM in reply to: maplezlt01

    Check the UCS of the drawing you are inserting things into and make sure it si set to "World"

    Please use plain text.
    Member
    Posts: 3
    Registered: ‎03-29-2012

    Re: Inconsistent insertion of blocks

    03-29-2012 12:30 PM in reply to: maplezlt01

    UCS values are correct, INS units are correct. I don't believe this is a system variable problem as the problem is intermittent. I can run the script two times in a row and have the same block that was supposed to be inserted at 0,0 at two different positions.

     

    Thanks.

    Please use plain text.
    Distinguished Contributor
    Posts: 130
    Registered: ‎10-08-2008

    Re: Inconsistent insertion of blocks

    03-29-2012 10:20 PM in reply to: maplezlt01

    I used to have the same problem.  If I remember correctly you have to set OSMODE to 0

     

    Like this:

     

    (defun C:*TEMP (/ OS)
    (setq OS (getvar "osmode"))
    (setvar "osmode" 0)
    (command ".insert" "*C:\\LGCY_User\\Temp_Export\\temp" "0,0" "1" "")
    (setvar "osmode" OS)
    (princ))

     

    GS

    Please use plain text.
    Member
    Posts: 3
    Registered: ‎03-29-2012

    Re: Inconsistent insertion of blocks

    03-30-2012 04:42 AM in reply to: maplezlt01

    I don't think it has anything to do with OSMODE as usually this is the first block I enter in a blank drawing and there is nothing to snap to.

     

    I've found a way around this glitch by adding a short line on the Defpoints layer a 0,0 to both my blocks and the template file. I allso changed my script to insert the block at 0,0 but the cutclip and pasteclip the last item at 0,0. So far it's worked. My only guess is that by not having any objects at 0,0 AutoCAD was a bit lost. So far this seems to work....

    Please use plain text.
    Distinguished Contributor
    Posts: 130
    Registered: ‎10-08-2008

    Re: Inconsistent insertion of blocks

    04-03-2012 10:22 PM in reply to: maplezlt01

    Of course I am not sure either, but several of my programs misbehaved at times when Osmode wasn't 0.  Since I always set it to 0 I don't have that problem.

    The above code is one half of a routine I use flipping objects between drawings and sometimes the entities came in at slightly different locations.  Same when attaching Xrefs.

    At any rate, my problems are solved.  AutoCAD can be weird at times.

    Please use plain text.