Lines not exactly horizontal or vertical

Discussion in 'AutoCAD' started by Ken Musser, Feb 6, 2004.

  1. Ken Musser

    Ken Musser Guest

    Hello All,

    I received a drawing from a client and some of the column grid lines are not
    perfectly horizontal or vertical. The lines are off by, at most, only a
    couple degrees. And each one can be off by a different amount. What makes it
    worse is depending on how much my screen is zoomed in or out, the lines may
    or may not visually be slanted. Has anyone automated a fix for this problem.
    It would be very much appreciated. Thanks alot.

    Ken
     
    Ken Musser, Feb 6, 2004
    #1
  2. Ken Musser

    ECCAD Guest

    Ken,
    Just thought of another thing. Might your UNITS #of decimal points be set to (4) and their's at (8) or such ? Might be - if you set your units (way out there), that the lines might appear proper ?
    IF that does not work, then check the line entities, and study the 'X' values for (10 xx.x....) and (11 xx.x....) to verify that they are 'really' not the same X for Vertical Lines ..

    Bob
     
    ECCAD, Feb 6, 2004
    #2
  3. sounds to me like the architect is sloppy..have you 'listed' the lines to
    see if they are at least parallel and perpendicular? If they are, I would
    just use a UCS aligned as required, or else rotate the whole drawing
    (assuming that everything else is square to those column lines).
     
    Martin Schmid, Feb 7, 2004
    #3
  4. Ken Musser

    btlsp Guest

    btlsp, Feb 8, 2004
    #4
  5. Ken Musser

    Joe Burke Guest

    Bob,

    I think this does it, similar to your suggestion. Not much testing.

    Joe Burke

    ;; 2/9/2004
    ;; range: if range is one degree
    ;; a line at angles 0.5, 89.5, 90.5 etc.
    ;; is changed by modifying its end point
    ;; lines at angles outside of range are not modified

    (defun c:FixLineAngles ( / range ss idx vobj startpt endpt ang )
    (while (not (< 0 range 45))
    (initget 5)
    (setq range (getreal "\nEnter angle range between 0 and 45 degrees: "))
    )
    (setq range (* pi (/ range 180.0))) ;dtr
    (setq ss (ssget (list (cons 0 "LINE"))))
    (setq idx 0)
    (if ss
    (repeat (sslength ss)
    (setq vobj (vlax-ename->vla-object (ssname ss idx)))
    (setq startpt (vlax-get vobj 'StartPoint))
    (setq endpt (vlax-get vobj 'EndPoint))
    (setq ang (vlax-get vobj 'Angle))
    (cond
    ;modify y value
    ((or
    (< 0 ang range)
    (> (* pi 2) ang (- (* pi 2) range))
    (> pi ang (- pi range))
    (< pi ang (+ pi range))
    )
    (vlax-put vobj 'EndPoint
    (list (car endpt) (cadr startpt) (caddr endpt)))
    )
    ;modify x value
    ((or
    (> (* pi 0.5) ang (- (* pi 0.5) range))
    (< (* pi 0.5) ang (+ (* pi 0.5) range))
    (> (* pi 1.5) ang (- (* pi 1.5) range))
    (< (* pi 1.5) ang (+ (* pi 1.5) range))
    )
    (vlax-put vobj 'EndPoint
    (list (car startpt) (cadr endpt) (caddr endpt)))
    )
    ) ;cond
    (setq idx (1+ idx))
    ) ;repeat
    ) ;if
    (princ)
    ) ;end

    parameter to be same as (10 xx.x yy.y z.z) by (entmod ent (subst (cons.... then,
    entupd. Fairly simple.
     
    Joe Burke, Feb 9, 2004
    #5
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.