Spline to pline

Discussion in 'AutoCAD' started by colin1234, Sep 24, 2004.

  1. colin1234

    colin1234 Guest

    is there a routine which one can use to convert a spline to a polyline?

    thanks

    Colin
     
    colin1234, Sep 24, 2004
    #1
  2. colin1234

    Doug Broad Guest

    Colin,
    What do you hope to accomplish? Would you want the
    translated version to be a spline curve fit pline or one that uses
    straight or arc curved segments to most closely approximate the
    spline curve?

    Regards,
    Doug
     
    Doug Broad, Sep 24, 2004
    #2
  3. colin1234

    BillZ Guest

    If you just want a facsimile of your spline:

    Use the measure command at desired distance and use the points to draw you pline. This can be done programically.

    Untested:

    (defun dup_spline (/ ent d1)
    (setq ent (car (entsel "\nselect spline")))
    (setq d1 (getdist "\nDistance between points."))
    (command ".measure" ent d1)
    (setq ptlist (ssget "P"))

    (setq cnt 0)
    (command ".pline")
    (repeat (sslength ptlist)
    (setq pt (cdr (assoc 10 (entget (ssname ptlist cnt))))
    cnt (1+ cnt))
    (command pt)
    )
    (command "cl")
    ;(entdel ent) ;remove semi colin to del spline
    )

    Bill
     
    BillZ, Sep 24, 2004
    #3
  4. colin1234

    BillZ Guest

    Oh yeah,

    If you want the points removed add (command ".erase" ptlist "")

    (defun dup_spline (/ ent d1)
    (setq ent (car (entsel "\nselect spline")))
    (setq d1 (getdist "\nDistance between points."))
    (command ".measure" ent d1)
    (setq ptlist (ssget "P"))

    (setq cnt 0)
    (command ".pline")
    (repeat (sslength ptlist)
    (setq pt (cdr (assoc 10 (entget (ssname ptlist cnt))))
    cnt (1+ cnt))
    (command pt)
    )
    (command "cl")
    ;(entdel ent) ;remove semi colin to del spline
    (command ".erase" ptlist "")
    )

    Bill
     
    BillZ, Sep 24, 2004
    #4
  5. colin1234

    colin1234 Guest

    I want the polyline to match the spline line such that after conversion i can change the width of the polyline easily to suit the purposes of the drawing.
     
    colin1234, Sep 24, 2004
    #5
  6. colin1234

    Jim Claypool Guest

    The FLATTEN command in 2004 and 2005 will convert it.
     
    Jim Claypool, Sep 24, 2004
    #6
  7. colin1234

    BillZ Guest

    Thanks Jim.

    I didn't know that.



    Bill
     
    BillZ, Sep 24, 2004
    #7
  8. colin1234

    Nava Ran Guest

    Nava Ran, Sep 24, 2004
    #8
  9. colin1234

    Jürg Menzi Guest

    Hi Colin

    Code:
    (command "_.DXFOUT" "Temp.dxf" "_OBJ" MySplinesSelectionSet ""
    "_VER" "_R12" "_BIN"
    "_.DXFIN" "Temp.dxf"
    )
    
    Cheers
     
    Jürg Menzi, Sep 24, 2004
    #9
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.