Invalid point??!?

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

  1. Matt W

    Matt W Guest

    I'm working with a modified version of a program found on Afralisp.com
    Here's what's supposed to happen...
    The user selects the line.
    The endpoints retrieved and then from that, the angle of the line.
    A block with 2 invisible attributes is inserted on the line at the same
    angle.
    The program retrieves the insertion points for the invisible attributes.
    The line is broken using the 2 insertion points of the attributes.

    However....the program throws a wobbly at the "BREAK" command saying
    "Invalid point".
    But, if I add the following line (command "line" ip1 ip2 ""), it draws a
    line right where the invisible attributes are, so what gives??

    Any help will be greatly appreciated!

    Here's the code:
    Code:
    (defun InsertValveX (strBlockName / lista objEnt pt1 ep1 ep2 ang edata
    ip1 ip2 objEntLine)
    (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)))
    (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 24, 2004
    #1
  2. Why not just use wipeouts?

    --
    R. Robert Bell


    I'm working with a modified version of a program found on Afralisp.com
    Here's what's supposed to happen...
    The user selects the line.
    The endpoints retrieved and then from that, the angle of the line.
    A block with 2 invisible attributes is inserted on the line at the same
    angle.
    The program retrieves the insertion points for the invisible attributes.
    The line is broken using the 2 insertion points of the attributes.

    However....the program throws a wobbly at the "BREAK" command saying
    "Invalid point".
    But, if I add the following line (command "line" ip1 ip2 ""), it draws a
    line right where the invisible attributes are, so what gives??

    Any help will be greatly appreciated!

    Here's the code:
    Code:
    (defun InsertValveX (strBlockName / lista objEnt pt1 ep1 ep2 ang edata
    ip1 ip2 objEntLine)
    (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)))
    (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)
    )
    
     
    R. Robert Bell, Nov 24, 2004
    #2
  3. Matt W

    Matt W Guest

    I'd love to, but our plotter doesn't support them. :(
    Got any other suggestions??!?
     
    Matt W, Nov 24, 2004
    #3
  4. I tried some comparative on-screen stuff, and it seems that IF you respond
    to Break's "Select object:" prompt with a saved entity (your "objEnt"),
    rather than by picking it on-screen, then the next prompt is "Specify first
    break point:", since it doesn't have one to work with yet. The "Invalid
    point" response seems to be because you're then giving it the "f", which
    would be appropriate if you had picked the line on-screen, but the only
    thing it wants is a point.

    You should be able to take the "f" out of your Break command part, and it
    ought to work right.
     
    Kent Cooper, AIA, Nov 24, 2004
    #4
  5. ; Break with "F" opt need a list (see entsel)

    (defun InsertValveX (strBlockName / lista objEnt ep1 ep2 ang
    ip1 ip2 objDat EntNam)
    (setvar "OSMODE" 0) (setvar "ATTREQ" 0)
    (setq
    objEnt (entsel "\nSelect line to add fitting to: ")
    objDat (entget (car objEnt))
    ep1 (cdr (assoc 10 objDat))
    ep2 (cdr (assoc 11 objDat))
    ang (/ (* (angle ep1 ep2) 180.0) pi)
    )
    (command
    "_.Insert" (strcat "s:/caddstds/demo/fittings/" strBlockName)
    "_NEA" (cadr objEnt) "" "" ang
    )
    ;(command "_.Insert" strBlockName "_NEA" (cadr objEnt) "" "" ang)
    (setq
    EntNam (entnext (dxf -1 (entget (entlast))))
    ip1 (dxf 10 (entget EntNam))
    ip2 (dxf 10 (entget (entnext EntNam)))
    )
    (command "_.Break" objEnt "_f" ip1 ip2)
    (princ)
    )


    --

    Marc'Antonio Alessi
    http://xoomer.virgilio.it/alessi
    (strcat "NOT a " (substr (ver) 8 4) " guru.")

    --
     
    Marc'Antonio Alessi, Nov 25, 2004
    #5
  6. Matt W

    Matt W Guest

    D'oh!
    Thank you. I think it was one of those times where you're looking at
    something for so long, that you can't seem to see straight (plus the holiday
    was right around the corner).

    Thanks a lot. Your feedback is very much appreciated!
     
    Matt W, Nov 29, 2004
    #6
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.