Continue a pline

Discussion in 'AutoCAD' started by TCEBob, Feb 28, 2004.

  1. TCEBob

    TCEBob Guest

    Trying for a utility to add on to a pline.
    ....entsel at the end
    ....break out the ent name and pick point
    ....(command "pline" pickpoint)
    Fine, so far, there are two plines. BUT, the new one did not pick up the
    elevation even though it is in the pickpoint.

    I can change it easily, but why wouldn't it use the elev?

    rs
     
    TCEBob, Feb 28, 2004
    #1
  2. TCEBob

    urugx Guest

    You must be on a plane view, not in isometric view.
     
    urugx, Feb 28, 2004
    #2
  3. TCEBob

    Jeff Mishler Guest

    Since Plines are 2d objetcs, they use the sysvar "elevation" for their
    elevation. Set that to the elev. derived from the pickpoint....don't forget
    to set it back to what it was...

    Jeff
     
    Jeff Mishler, Feb 28, 2004
    #3
  4. TCEBob

    TCEBob Guest

    If I begin a pline manually with a snap end it picks up the snapped
    elevation. Just won't do it programmatically. As I said, It's not hard
    to change. I'm not real comfortable messing with "elevation" without an
    ironclad error routine to restore it in case.

    Thanks, Jeff

    rs
     
    TCEBob, Feb 28, 2004
    #4
  5. TCEBob

    Jeff Mishler Guest

    OK, Bob, Now you made me go try it ;-)

    I mis-spoke in my first reply since I relied completely on what you posted
    and didn't check it out.....

    Anyway, I just tried it and got different results than what you
    describe.....using 2002, not '04 like you, but I don't recall this being
    listed as one of the changes.

    (setq pt1 (getpoint));used "_end" to pick the end of the pline
    (11901.3 10196.5 55.0)
    (command "pline" pt1); then pick 2 more random points.
    (entget (entlast))
    ((-1 . <Entity name: 4009df70>) (0 . "LWPOLYLINE") (330 . <Entity name:
    40092cb8>) (5 . "9146") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 .
    "STA") (100 . "AcDbPolyline") (90 . 3) (70 . 0) (43 . 0.0) (38 . 55.0) (39 .
    0.0) (10 11901.3 10196.5) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 11900.4
    10209.0) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 11909.2 10210.1) (40 . 0.0)
    (41 . 0.0) (42 . 0.0) (210 0.0 0.0 1.0))

    As you can see, assoc 38 is 55.0 which is the elevation of the original
    pline.....so now try it with entsel:

    (setq sel (entsel))
    (<Entity name: 4009df70> (11901.3 10196.5 55.0))
    (setq pt1 (car (cdr sel)))
    (11901.3 10196.5 55.0)
    (command "pline" pt1); then pick 2 more random points.
    (entget (entlast))
    ((-1 . <Entity name: 4009df78>) (0 . "LWPOLYLINE") (330 . <Entity name:
    40092cb8>) (5 . "9147") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 .
    "STA") (100 . "AcDbPolyline") (90 . 3) (70 . 0) (43 . 0.0) (38 . 55.0) (39 .
    0.0) (10 11901.3 10196.5) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 11901.4
    10205.2) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 11908.7 10206.7) (40 . 0.0)
    (41 . 0.0) (42 . 0.0) (210 0.0 0.0 1.0))

    Again, assoc 38 is 55.0.......

    Strange goings on here,

    Jeff
     
    Jeff Mishler, Feb 28, 2004
    #5
  6. TCEBob

    TCEBob Guest

    Hokay, here's what happened. The entsel command will not recognize
    current osnaps. But getpoint will. So the following at least solves that
    problem:

    (defun c:plc( / osm) ;;;pline continue
    (setvar "peditaccept" 1)
    (setq osm (getvar "osmode"))
    (setvar "osmode" 1)
    (setq pt(getpoint "\nSelect the END of a pline: "))
    (setq ss(ssget pt))
    (setq ppname(ssname ss 0))
    (setvar "osmode" osm)
    (command "pline" pt pause "")
    ;;(command "pedit" ppname "join" "l")
    (princ)
    )

    Next step: find that trick with cmdactive to extend the pline command.
    Then: Join 'em.

    rs
     
    TCEBob, Feb 28, 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.