AutoCAD 2010/2011/2012

Reply
Member
maplezlt01
Posts: 3
Registered: ‎03-29-2012
Message 1 of 6 (190 Views)

Inconsistent insertion of blocks

190 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

*Pro
murray-clack
Posts: 1,805
Registered: ‎12-08-2003
Message 2 of 6 (174 Views)

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"

Member
maplezlt01
Posts: 3
Registered: ‎03-29-2012
Message 3 of 6 (171 Views)

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.

Distinguished Contributor
AMC663
Posts: 130
Registered: ‎10-08-2008
Message 4 of 6 (157 Views)

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

Member
maplezlt01
Posts: 3
Registered: ‎03-29-2012
Message 5 of 6 (151 Views)

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

Distinguished Contributor
AMC663
Posts: 130
Registered: ‎10-08-2008
Message 6 of 6 (136 Views)

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.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.