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
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.
I used to have the same problem. If I remember correctly you have to set OSMODE to 0
(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)
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....
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.