See the top rated post in this thread. Click here

Results 1 to 2 of 2

Thread: Faulty Variable Allocation ????

  1. #1
    The Silent Type
    Join Date
    Login to Give a bone

    Default Faulty Variable Allocation ????

    I have no idea if I am titling this thread correctly but it was the best I could do.

    Short version: when told to draw a line from ptxx (a var containing x and y coords) AutoCAD starts from some point other than what is stored in ptxx....sometimes!!!!

    Long version:
    I have a program giving me trouble, or so I thought. Drawing a fairly simple shape of 20 points connected with lines or even 1 pline. Program runs perfectly one to several times in a row then draws something unexpected one or several times. Seems to be random and after much effort I can not isolate any event that seems to cause this. Rewrote the program a couple times in different ways only to get the same result. Now I think it may not be the program and may be my system.

    Turning off all local declarations and running the program until it does something unexpected, and then...

    From the command line: !pt10 , !pt11 , !pt12 ,OR !pt13 returns (13.0 16.0) , (13.0 13.0) , (16.0 13.0) , (16.0 12.375) respectively. These are 4 separate pts with different values and all correct as to what would be expected from the code generating them.

    Now from the command line: (command "line" some-point) using pt10, 11, 12, or 13 ALL FOUR start the line command at the first point of (16.0 13.0). The correct location for only pt12.

    What am I missing?


    Running AutoCAD Architectural 2011 with no other known bugs on a decent machine with Windows 10.

    ;; attached files
    YelloHelp.lsp has the code if you would like to see it
    Acceptable.jpg shows the only two basic shapes that should be generated by this code. Sizes and chamfer angles may vary.

    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    All AUGI, all the time marko_ribar's Avatar
    Join Date
    Belgrade, Serbia, Europe
    Login to Give a bone

    Default Re: Faulty Variable Allocation ????

    Are you sure you turned OSNAPS off and 3DOSNAPS off if it is implemented in your AutoCAD version...

    (defun c:foo ( / osm 3dos ... )
      (setq osm (getvar 'osmode))
      (setvar 'osmode 0)
      (if (setq 3dos (getvar '3dosmode))
        (setvar '3dosmode 0)
      Your code comes here...
      (setvar 'osmode osm)
      (if 3dos
        (setvar '3dosmode 3dos)
    HTH., M.R.
    Marko Ribar, d.i.a. (graduated engineer of architecture)

    M.R. on Youtube

Similar Threads

    By SAWMAN56 in forum AutoCAD General
    Replies: 2
    Last Post: 2017-05-03, 05:29 PM
  2. 2016: How can I find faulty Room boundary?
    By m.knutsson in forum Revit Architecture - General
    Replies: 1
    Last Post: 2017-04-12, 02:30 PM
  3. Image Frame "DO NOT PLOT" setting faulty/unreliable
    By Wish List System in forum AutoCAD Wish List
    Replies: 2
    Last Post: 2017-04-08, 02:32 PM
  4. Faulty View Range
    By dillon_manning in forum Revit - Platform
    Replies: 4
    Last Post: 2012-02-10, 11:55 PM
  5. printer re allocation
    By jducardus in forum AutoCAD General
    Replies: 5
    Last Post: 2010-05-05, 10:34 PM

Posting Permissions

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