What's wrong with this...??

Discussion in 'AutoCAD' started by Matt W, Nov 19, 2004.

  1. Matt W

    Matt W Guest

    Here's a little something that I've recently started... It's a modified
    version of the AfraLisp program to automatically break a line when a block
    with invisible attributes is inserted, however, it doesn't seem to like my
    attribute insertion points (IP1 and IP2).

    They seem to be "off" just a tad.
    Anyone see something I'm missing??!?

    Code:
    (defun InsertValve (strBlockName / lista objEnt pt1 ep1 ep2 ang edata ip1
    ip2 objEntLine)
    (setvar "cmdecho" 0)
    (setvar "osmode" 512)
    (setq pt1 (getpoint "\n Select line to add fitting to... "))
    (setvar "osmode" 0)
    
    (setq objEnt (ssget pt1))
    (setq objEntLine objEnt)
    
    (setq objEnt (entget (ssname objEnt 0)))
    (setvar "clayer" (cdr (assoc 8 objEnt2)))
    (setvar "cecolor" "1")
    (setq ep1 (cdr (assoc 10 objEnt)))
    (setq ep2 (cdr (assoc 11 objEnt)))
    (setq ang (angle ep1 ep2))
    (setq ang (/ (* ang 180.0) pi))
    (setvar "ATTDIA" 0)
    (command "Insert" (strcat "s:/caddstds/demo/fittings/" strBlockName)
    pt1 "" "" ang "" "")
    (setq edata (entget (entlast)))
    (setq edata (entget (entnext (dxf -1 edata))))
    (setq ip1 (dxf 10 edata))
    (setq edata (entget (entnext (dxf -1 edata))))
    (setq ip2 (dxf 10 edata))
    (command "Break" objEntLine "f" ip1 ip2)
    (princ)
    )
    
     
    Matt W, Nov 19, 2004
    #1
  2. Matt W

    ECCAD Guest

    To get the proper points, you may have to 'adjust' for
    the angle. Re-calculate points, using distance, and polar.

    Bob
     
    ECCAD, Nov 20, 2004
    #2
  3. Matt W

    Matt W Guest

    I shouldn't have to adjust for anything; I'm getting the insertion points of
    the invisible attributes.
    I don't need to use angle or polar for that.
     
    Matt W, Nov 22, 2004
    #3
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.