+ Reply to Thread
Results 1 to 7 of 7

Thread: script issue

  1. #1
    Forum Newbie
    Using
    AutoCAD 2011
    Join Date
    Apr 2012
    Posts
    6

    Default script issue

    Registered forum members do not see this ad.

    My insert script always plots different results(some of the locations are off by a little bit, but not much, and every time is different depends on the mood of the computer)... unless I manually paste them line by line which complete defeats the purpose of having a script.

    Can anyone help please? here is what it looks like:
    Code:
    (command "-insert" "RK_112" "_S" 1 "11648,18562,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,18430,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,18562,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,18430,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,18562,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,18430,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,18562,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,18430,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,18278,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,18146,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,18278,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,18146,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,18278,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,18146,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,18278,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,18146,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17994,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17862,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17994,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17862,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17994,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17862,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17994,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17862,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17710,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17578,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17710,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17578,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17710,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17578,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17710,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17578,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17426,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17294,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17426,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17294,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17426,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17294,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17426,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17294,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17142,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17010,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17142,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,17010,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17142,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17010,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17142,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,17010,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,16858,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,16726,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,16858,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,16726,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,16858,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,16726,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,16858,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,16726,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,16574,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,16442,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,16574,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,16442,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,16574,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,16442,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,16574,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,16442,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,16290,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,16158,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,16290,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,16158,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,16290,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,16158,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,16290,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,16158,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,16006,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,15874,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,16006,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,15874,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,16006,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,15874,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,16006,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,15874,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,15722,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,15590,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,15722,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,15590,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,15722,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,15590,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,15722,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,15590,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,15438,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,15306,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,15438,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,15306,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,15438,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,15306,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,15438,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,15306,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,15154,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,15022,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,15154,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,15022,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,15154,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,15022,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,15154,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,15022,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,14870,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,14738,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,14870,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,14738,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,14870,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,14738,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,14870,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,14738,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,14586,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,14454,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,14586,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,14454,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,14586,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,14454,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,14586,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,14454,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,14302,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,14170,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,14302,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,14170,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,14302,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,14170,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,14302,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,14170,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,14018,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,13886,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,14018,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,13886,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,14018,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,13886,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,14018,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,13886,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,13734,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,13602,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,13734,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,13602,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,13734,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,13602,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,13734,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,13602,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,13450,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,13318,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,13450,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,13318,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,13450,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,13318,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,13450,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,13318,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,13166,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,13034,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,13166,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,13034,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,13166,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,13034,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,13166,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,13034,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,12882,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,12750,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,12882,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,12750,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,12882,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,12750,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,12882,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,12750,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,12598,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,12466,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,12598,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,12466,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,12598,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,12466,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,12598,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,12466,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,12314,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,12182,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,12314,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11648,12182,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,12314,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,12182,0" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,12314,130" 90)
    (command "-insert" "RK_112" "_S" 1 "11314,12182,130" 90)
    Last edited by cursedeye; 1st Aug 2012 at 05:08 pm. Reason: change code format, add tag

  2. #2
    Forum Newbie
    Using
    AutoCAD 2011
    Join Date
    Apr 2012
    Posts
    6

    Default

    ok..
    update: although every time it gives different results, the common issue is that the blocks that are off, although different ones every time, always sit on an edge or midpoint of others. So I turned off Object Snap and 3D Object Snap and it worked (at least none was off by too much…) and finished even faster than before…

    But I can’t really tell if it really worked because 1, I’m not sure if that’s the real cause, 2. it’s impossible to check all the coordinates, since I have over 10k objects.

    please help

  3. #3
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x86
    CPU:
    Pentium(R) Dual-Core CPU E5500 @ 2.80GHz
    RAM:
    4 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    ThinkVision 22"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2011
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    9,134

    Default

    Please read the CODE POSTING GUIDELINES and edit your post to include code tags!

    Thread moved to The CUI, Hatches, Linetypes, Scripts & Macros forum.
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



  4. #4
    Forum Newbie
    Using
    AutoCAD 2011
    Join Date
    Apr 2012
    Posts
    6

    Default

    sorry about that. It's been changed.

  5. #5
    Forum Deity
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    3,791

    Default

    A couple of suggestions add a turn off snaps at start and chuck in a few zoom e Autocad can do some funny stuff if it cant see what its doing as in off screen.

    Code:
    Zoom E
    (setq oldsnap (getvar "osmode"))
    (setvar osmode 0)
    command "insert"......
    command "insert"......
    command "insert"......
    Zoom E 
    command "insert"......
    command "insert"......
    command "insert"......
    (setvar "osmode "oldsnap")
    (alert "all done")
    A man who never made mistakes never made anything

  6. #6
    Forum Newbie
    Using
    AutoCAD 2011
    Join Date
    Apr 2012
    Posts
    6

    Default

    Thanks for your suggestions.

    I can understand the turn off Snap part...but do you know if it is the cause of this problem? and why?

    I don't really understand why I need to have a Zoom E...could you please explain this?

  7. #7
    Forum Deity
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    3,791

    Default

    Registered forum members do not see this ad.

    Like I said I have had problems many years of automating Autocad, two areas, not far enough out so stuff works, not close enough in so stuff works. The way around if still not working is try zoom c Pt scalefactor the Pt would be say an insert point of one of your blocks the scalefactor some number big enough to see whats goin on. maybe just Z C Pt scale at start and problems may go away. Having a look your going 6000 units thats a lot it could well be zooming problem.

    Try dataextract it will list all blocks to excell can ramdomly check then any problems should turn up straight away you could do a if xyz1 <> xyz2 False
    A man who never made mistakes never made anything

Similar Threads

  1. Model scale / VP scale issue / Co-ordinates issue
    By Richard Radford in forum AutoCAD Beginners' Area
    Replies: 5
    Last Post: 26th Aug 2010, 11:16 am
  2. Script opening script
    By zera in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 7th Jan 2010, 08:01 pm
  3. Script
    By mapman1 in forum Civil 3D & LDD
    Replies: 3
    Last Post: 5th Jun 2009, 02:35 pm
  4. help with a Script
    By Joel Westreich in forum AutoCAD Drawing Management & Output
    Replies: 13
    Last Post: 26th Feb 2008, 07:38 pm
  5. Sub script and Super script Text
    By edwin in forum AutoCAD Beginners' Area
    Replies: 2
    Last Post: 1st Aug 2007, 08:07 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts