Changing X,Y Coordinates

Discussion in 'AutoCAD' started by crrussell3, Oct 21, 2004.

  1. crrussell3

    crrussell3 Guest

    I am having a very strange occurance to a program I have written to help in creating/placing of attdefs inside of a caseblock.

    The user would pick an upper left hand corner and a upper right hand corner of a rectangle. The upper left hand corner is always at 0,0,0 and the upper right hand corner is variable, but lets say for this example its 144,0,0.

    The program then goes to create/insert attdef's in those points, but first the program will "move" the points so they are positioned slightly off of the rectangle's outter edge, 3 units x, 2 units y.

    The wierd thing is is sometimes the programs puts them in correctly, othertimes it puts them in as if it ignored the change in coordinates, other times in puts them in wierd places, usually farther away then what it was told.

    Here is the code. Please tell me if there is a better way, which I am sure there is, to do this.

    OS= Windows 2000
    Acad = Autocad 2004

    (DEFUN C:CBA (/ PT1 PT2)

    (IF (NOT (TBLSEARCH "layer" "-CASE_ID"))
    (PROGN
    (ENTMAKE
    (LIST
    '(0 . "LAYER")
    '(100
     
    crrussell3, Oct 21, 2004
    #1
  2. crrussell3

    MP Guest

    ;;;SET OSNAPS TO NONE BEFORE PLACING ATTDEF
    (SETVAR "OSMODE" 0)

    ;;; OR USE "NON" MODIFIER
    (COMMAND "ATTDEF" "" "CASE-NAME1" "" "" "J" "TL" "_NON" (POLAR PT1
    5.30039 3.625) "9" "0")
    (COMMAND "ATTDEF" "" "CASE-NAME2" "" "" "J" "TL" "_NON" (POLAR PT2
    4.54724 12.125) "9" "180")
    hope that helps
    Mark
     
    MP, Oct 21, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.